home *** CD-ROM | disk | FTP | other *** search
- /*
- File: FWiXDriver.h
-
- Contains: Definitions for FWiXDriver.
-
- Version: 1.0
-
- Written by: Jay Lloyd
-
- Copyright: © 1996-1998 by Apple Computer, Inc., all rights reserved.
-
- File Ownership:
-
- DRI: Jay Lloyd
-
- Other Contact:
-
- Technology: FireWire
-
- Writers:
-
- (jkl) Jay Lloyd
-
- Change History (most recent first):
-
- <FW16> 7/7/98 jkl Add address space ID for local data buffer to FWXNodeDataStruct.
- <FW15> 5/28/97 jkl Added control indexing fields to node data structure.
- <FW14> 5/15/97 jkl Added two fields to the node data structure, a boolean to tell
- if transfer is halted due to flow control, and an index for flow
- control messages.
- <FW13> 2/21/97 ES Added in use flags for all FWCommandObjects.
- <FW12> 2/21/97 jkl Modified driver and node data structure fields for sending data
- to non notify address space.
- <FW11> 2/19/97 jkl Added a flow control pending flag in the node data structure.
- <FW10> 2/14/97 jkl Added flow control request and reply fields to node data
- structure.
- <FW9> 2/13/97 jkl Added another received packet counter field in node data
- structure.
- <FW8> 2/13/97 jkl Changed flow control counters in node data structure.
- <FW7> 2/11/97 ES Added closed field to FWXNodeData record.
- <FW6> 2/11/97 jkl Added fields in node data for read control and data queues and
- flow control mechanism.
- <FW5> 1/8/97 ES Changed to a FireWire protocol driver. Removed fixed FireWire
- address allocation.
- <FW4> 11/13/96 jkl Moved from DoDriverIO interface to CallDriver. Added multiple
- machine support.
- <FW3> 10/31/96 jkl Added constants for flow control
- <FW2> 10/16/96 jkl Added address space id's and a flow control
- buffer to the driver globals.
- <FW1> 10/2/96 jkl Initial check-in, copied from avc driver.
-
- */
-
- #ifndef __FWIXDRIVER__
- #define __FWIXDRIVER__
-
- #ifndef __TYPES__
- #include <Types.h>
- #endif
- #ifndef __FIREWIRE__
- #include <FireWire.h>
- #endif
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import on
- #endif
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=mac68k
- #endif
-
- enum {
- kFlowControlSize = 12, // 3 longs
- kDataDoneBufSize = 16
- };
-
- typedef struct FWXDriverDataStruct
- FWXDriverData,
- *FWXDriverDataPtr;
-
- typedef struct FWXNodeDataStruct
- FWXNodeData,
- *FWXNodeDataPtr;
-
- typedef struct FWXUnitInfoStruct
- FWXUnitInfo,
- *FWXUnitInfoPtr;
-
- struct FWXDriverDataStruct
- {
- FWPDriverID fwPDriverID; // Our FireWire protocol driver ID.
- FWXDriverID fwxDriverID; // Our FWX driver ID.
- FWXNodeDataPtr fwxNodeDataList; // List of node data records.
- CSRROMEntryID unitCSRROMEntryID; // ID of unit directory on local node.
- Ptr controlBuffer; // a control packet buffer
- Ptr fcBuffer; // a flow control packet buffer
- FWAddressSpaceID controlAddressSpaceID; // id of address space for control packets
- FWAddress controlAddress; // address space for control packets
- FWAddressSpaceID fcAddressSpaceID; // id of address space for flow control packets
- FWAddress fcAddress; // address space for flow control packets
- };
-
- struct FWXUnitInfoStruct
- {
- FWAddress controlAddress; // Address to send control packets to.
- FWAddress fcAddress; // Address to send flow control packets to.
- };
-
- struct FWXNodeDataStruct
- {
- FWXNodeDataPtr pPrevFWXNodeData, // Previous and next node data records.
- pNextFWXNodeData;
- FWXDriverDataPtr pFWXDriverData; // Our driver data.
- FWUnitID fwUnitID; // Unit ID of node.
- FWDeviceID fwDeviceID; // Device ID of node.
- FWCommandObjectID writeAsynchCommandObjectID; // Command object for asynchronous write transactions.
- FWCommandObjectID fcSendCommandObjectID; // Command object for asynchronous flow control requests.
- FWCommandObjectID fcReplyCommandObjectID; // Command object for asynchronous flow control replies.
- FWAddress remoteDataAddress; // remote node's address space for my data packets
- FWAddressSpaceID localDataAddressSpaceID; // id of address space for remote node's data packets
- FWAddress localDataAddress; // my address space for remote node's data packets
- Ptr dataBuffer; // space for receiving data from node
- FWXUnitInfo fwxUnitInfo; // Unit information about node.
- TimerID fcTimerID; // flow control timer
- QHdrPtr pReadControlQHdr; // queued read parameter blocks
- QHdrPtr pReadDataQHdr; // queued read parameter blocks
- QHdrPtr pWriteQHdr; // queued write parameter blocks
- IOParamPtr pCurIOParam; // parameter block being processed
- SInt32* dataDoneBuffer; // a flow control buffer
- SInt32* fcSendBuffer; // a flow control buffer
- SInt32* fcReplyBuffer; // a flow control buffer
- SInt32 dataPbCount; // number of read data parameter blocks
- SInt32 controlPbCount; // number of read control parameter blocks
- SInt32 dataPbAvail; // number of read data parameter blocks available to sender
- SInt32 controlPbAvail; // number of read control parameter blocks available to sender
- UInt32 fcIndex; // counts flow control messages
- UInt32 lastIndex; // holds index of last received control message
- UInt32 controlIndex; // counts sent control messages
- Boolean fcStopSend; // true if a write is in progress
- Boolean writePending; // true if a write is in progress
- Boolean unitConnectionAdded; // True if we've added our connection to our unit.
- Boolean closed; // True if node connection has been closed.
- Boolean writeAsynchCommandObjectInUse; // True if writeAsynchCommandObject is in use.
- Boolean fcSendCommandObjectInUse; // True if fcSendCommandObject is in use.
- Boolean fcReplyCommandObjectInUse; // True if fcReplyCommandObject is in use.
- };
-
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=reset
- #endif
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import off
- #endif
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* __FWIXDRIVER__ */
-